﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using emp.ProcessFlow;
using emp.BLL;
using emp.Model;

public partial class basedata_Task_Schedule_TaskScheduleSetup_List : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void add_click(object sender ,EventArgs e)
    {
        Response.Redirect("TaskScheduleSetupAdd.aspx");
}
    protected void PageChanged(object sender, DataGridPageChangedEventArgs e)
    {
        if (!IsPostBack)
        {
            questlist.CurrentPageIndex = e.NewPageIndex;
            TaskScheduleSetup tss = new TaskScheduleSetup();
            IList list = tss.getTask_Schedule_Setup();
            this.questlist.DataSource = list;
            this.questlist.DataBind();


            int iCurrentPageIndex = questlist.CurrentPageIndex;

            for (int i = 0; i < questlist.Items.Count; i++)
            {
                Literal labstate = (Literal)questlist.Items[i].FindControl("lab_type");
                Literal labnum = (Literal)questlist.Items[i].FindControl("lab_state");


                if (labstate.Text.EndsWith("D"))
                {
                    labstate.Text = "每天";
                    // laboption.Text = "<img src='../../pub/crm/images/se.gif' alt='查看' border='0' />";
                }
                else if (labstate.Text.EndsWith("W"))
                {
                    labstate.Text = "每周";
                }
                else
                {
                    labstate.Text = "每月";
                    //  laboption.Text = "<a href='CellGenerateResult.aspx?mtmUid=" + labid.Text + "&mcdUid=" + labmcd_uid.Text + "&cur_page=" + iCurrentPageIndex + "'><img src='../../pub/crm/images/se.gif' alt='查看' border='0' /></a>";
                }


                if (labnum.Text.EndsWith("Y"))
                {
                    labnum.Text = "有效";
                }
                else
                {
                    labnum.Text = "无效";
                }
                //labnum.Text = cellGen.getUser_Num(int.Parse(labid.Text)).ToString();


            }
        }
    }
}
